package java06;

import java.util.Scanner;

public class 逢7过 {
    public static void main(String[] args) {
//        printNoneSeven();


//        int[] arr={68,27,95,88,171,996,51,210};
//        int sum=getSum(arr);
//        System.out.println(sum);

//        int[]arr1={11,22,33};
//        int[]arr2={11,22,33};
//        boolean ans=checkArrContent(arr1,arr2);
//        System.out.println(ans);

        Scanner sc=new Scanner(System.in);
        int[] arr ={19,28,37,46,50,19,19};int value=sc.nextInt();
        int[] index=findIndex(arr,value);
        if(index==null||index.length==0){
            System.out.println("NO");
        }else {
            for(int i=index.length-1;i>=0;i--){
                System.out.println(index[i]);
            }
        }


    }

    public static void printNoneSeven() {
        int i=1;
        while(i<=100) {
            int ge=i%10;
            int shi=i/10%10;
            if(ge!=7 && shi!=7 && i%7!=0) {
                System.out.println(i);
            }
            i++;
        }
    }

    public static  int getSum(int arr[]) {
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            int ge=arr[i]%10;
            int shi=i/10%10;
            if(ge!=7 && shi!=7 && arr[i]%2==0) {
                sum+=arr[i];
            }
        }
        return sum;
    }

    public static boolean checkArrContent(int[] arr1, int[] arr2) {
        if(arr1.length!=arr2.length) {
            return false;
        }
        for(int i=0;i<arr1.length;i++) {
            if(arr1[i]!=arr2[i]) {
                return false;
            }
        }
        return true;
    }

    public static int[] findIndex(int[] arr,int value) {
        int count=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==value) count++;
        }
        int[] index=new int[count];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==value) {
                index[count-1]=i;
                count--;
            }
        }
        return index;
    }
}
